package frsf.cidisi.exercise.tp1.search;

import java.util.Vector;

import frsf.cidisi.faia.agent.Perception;
import frsf.cidisi.faia.agent.search.SearchBasedAgentState;
import frsf.cidisi.faia.state.datastructure.Pair;

/**
 * Represent the internal state of the Agent.
 */
public class EstadoExplorador extends SearchBasedAgentState {
	
	//TODO: Setup Variables hecho
    private Pair posicion;
    private int orientacion;
    private boolean tieneLlave;
    private Vector<Salida> salidasLab;
    private Vector<Pair> entradasLab;
    private Pair posLlaveLab;
    private Vector<Vector<Celda>> laberintoConocido;
    
	
    /**
     * Constructor
     */
    public EstadoExplorador() {
    
    	//TODO: Complete Method hecho constructor EstadoExplorador
         //this.initState();
    }
    
    public EstadoExplorador(Pair posicion, int orientacion, boolean tieneLlave,
			Vector<Salida> salidasLab, Vector<Pair> entradasLab,
			Pair posLlaveLab, Vector<Vector<Celda>> laberintoConocido) {
		super();
		this.posicion = posicion;
		this.orientacion = orientacion;
		this.tieneLlave = tieneLlave;
		this.setSalidasLab(salidasLab);
		this.setEntradasLab(entradasLab);
		this.posLlaveLab = posLlaveLab;
		this.laberintoConocido = laberintoConocido;
		
		
	}

	/**
     * This method clones the state of the agent. It's used in the search
     * process, when creating the search tree.
     */
    @Override
    public SearchBasedAgentState clone() {
		//TODO: Complete Method hecho
    	
    	EstadoExplorador agStateClon= new EstadoExplorador(getposicion().clone(), getorientacion(), gettieneLlave(),
    			(Vector<Salida>)getSalidasLab().clone(), (Vector<Pair>)getEntradasLab().clone(),
    			(Pair)getposicion().clone(), (Vector<Vector<Celda>>)getlaberintoConocido().clone() );
    			
        return agStateClon;
    }

    /**
     * This method is used to update the Agent State when a Perception is
     * received by the Simulator.
     */
    @Override
    public void updateState(Perception p) {
        
        //TODO: Complete Method pasa el laberinto de cada nivel
    }

    /**
     * This method is optional, and sets the initial state of the agent.
     */
    @Override
    public void initState() {
        
	//TODO: Complete Method no nec

    }

    /**
     * This method returns the String representation of the agent state.
     */
    @Override
    public String toString() {
        String str = "";

        //TODO: Complete Method no nec

        return str;
    }

    /**
     * This method is used in the search process to verify if the node already
     * exists in the actual search.
     */
    @Override
    public boolean equals(Object obj) {
       
       //TODO: Complete Method
        
        return true;
    }

    //TODO: hecho Complete this section with agent-specific methods
    // The following methods are agent-specific:
   	
     public Pair getposicion(){
        return posicion;
     }
     public void setposicion(Pair arg){
        posicion = arg;
     }
     public int getorientacion(){
        return orientacion;
     }
     public void setorientacion(int arg){
        orientacion = arg;
     }
     public boolean gettieneLlave(){
        return tieneLlave;
     }
     public void settieneLlave(boolean arg){
        tieneLlave = arg;
     }

     public Pair getposLlaveLab(){
        return posLlaveLab;
     }
     public void setposLlaveLab(Pair arg){
        posLlaveLab = arg;
     }
     public Vector<Vector<Celda>> getlaberintoConocido(){
        return laberintoConocido;
     }
     public void setlaberintoConocido(Vector<Vector<Celda>> arg){
        laberintoConocido = arg;
     }

	public void setSalidasLab(Vector<Salida> salidasLab) {
		this.salidasLab = salidasLab;
	}

	public Vector<Salida> getSalidasLab() {
		return salidasLab;
	}

	public void setEntradasLab(Vector<Pair> entradasLab) {
		this.entradasLab = entradasLab;
	}

	public Vector<Pair> getEntradasLab() {
		return entradasLab;
	}
	
}

